Skip to content

add unicode_encode and unicode_decode DSL functions - #326

Open
ChrisJr404 wants to merge 1 commit into
projectdiscovery:mainfrom
ChrisJr404:feat/unicode-dsl
Open

add unicode_encode and unicode_decode DSL functions#326
ChrisJr404 wants to merge 1 commit into
projectdiscovery:mainfrom
ChrisJr404:feat/unicode-dsl

Conversation

@ChrisJr404

Copy link
Copy Markdown
Contributor

Closes #256.

Adds unicode_encode and unicode_decode helper functions, in the same spirit as the existing hex_encode/hex_decode and url_decode helpers.

unicode_encode turns a string into \uXXXX escapes (and \UXXXXXXXX for runes outside the BMP). unicode_decode reverses it, decoding any \u/\U escape runs and leaving the rest of the text untouched, so it also works on mixed content. This helps in extractors where a response hands back \uXXXX escaped text (page titles from some sites, for example) and you want to match on the actual characters.

Added a round trip test plus a few decode cases, and updated the function signature list test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unicode encoding and decoding functionality

1 participant